<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<!-- 针对数字：部分手机会将数字当作电话号码，加上这句代码就不会 -->
<meta name="format-detection" content="telephone=no" >
<title>我的快递</title>
<%@ include file="/pages/wx/baseHead.jsp"%>
<!-- #cb60b3 -->

<script type="text/javascript">
	
	
	$(function(){
	});
	
	
	/*签收*/
	function dilivery(sn,type)
	{
		var url = "";
		if(type == '1')
		{
			url = '${urlBasePath}weixin/expressReceive.do';
		}else if(type == '2')
		{
			url = '${urlBasePath}weixin/user/expressPick.do';
		}
		confirm('提示','确定签收？',function(){
			$.ajax({
				url:url,
				async:true,
				data:{
					sn:sn
				},
				success:function(ret){
					if(ret.code == '0')
					{
						openToast('操作成功');
						var adr1 = '#state'+type+sn;
						var adr2 = '#btn'+type+sn;
						$(adr1).html("已签收");
						hide(adr2);
					}else
					{
						openDia('提示',ret.msg);
					}
				},
				error:function(){
					alert('系统错误');
				}
			});
			
		});
	}
	
</script>

</head>
<body>
<form action="${urlBasePath }weixin/user/expressMyReceive.do" id="theform" name="theform" method="post">
	<div class="bd" style="height: 100%;width: 100%; position: fixed;">
	    <div class="weui_tab">
	        <div class="weui_navbar">
	            <div class="weui_navbar_item " onclick="to('${urlBasePath }weixin/user/expressMySend.do');" >
	                	已寄快递
	            </div>
	            <div class="weui_navbar_item weui_bar_item_on" onclick="to('${urlBasePath }weixin/user/expressMyReceive.do');" style="color: #ffffff;background-color: #04BE02;">
	               		收快递
	            </div>
	        </div>
	        <div class="weui_tab_bd">
				<div class="weui_panel weui_panel_access" style="margin-top: -4px;">
			        <!-- <div class="weui_panel_hd" style="font-size: 1.2em;color: #000000">快递列表</div> -->
			        <!-- <div class="alert alert-danger" role="alert"><i class="fa fa-map-marker fa-fw"></i>快递列表</div> -->
				      <div class="weui_panel_bd">
				      
				        <div class="input-group margin-bottom-sm form-inline has-success" style="padding: 10px 0 10px 0;text-align: center;display: none;">
						  <input class="form-control col-md-3" type="text" value="${q.expressNo }" name="expressNo" placeholder="请填入您想搜索的快递单号" style="height: 46px;z-index: 1;" >
						  <span class="input-group-addon"><a href="javascript:void(0);" onclick="goPage(1);"><i class="fa fa-search fa-sm"></i></a></span>
					    </div>
				      
				        <c:forEach var="obj" items="${objs.data }" >
				        	<c:if test="${obj.type == '1' }">
					            <div class="weui_media_box weui_media_appmsg form-inline">
					                <div class="weui_media_bd">
					                    <h4 class="weui_media_title" style="width: 100%;" onclick="to('${urlBasePath}weixin/toExpressReceive.do?sn=${obj.sn }');">寄件人：${obj.fromName }      
					                    	<div style="float: right;font-size: .8em;">
											     <i class="fa fa-calendar fa-fw"></i><fmt:formatDate value="${obj.createTm}" pattern="yyyy-MM-dd"/>
											</div>
					                    </h4>
					                    <%-- <p class="weui_media_desc"><i class="fa fa-th-list fa-fw"></i>订单号：${obj.sn }</p> --%>
					                     <p class="weui_media_desc">
					                    	签收状态：
					                    	<span style="width: 60%" id="state${obj.type }${obj.sn}">
					                    		<c:forEach var="state" items="${states }">
								                	<c:if test="${state.value == obj.state }">
										                    	${state.text }
								                  	 </c:if>
								                </c:forEach>
					                    	</span>
					                    </p>
					                     <p class="weui_media_desc">
					                    	寄件电话：
					                    	<span style="width: 60%">${obj.fromPhone }</span>
					                    </p>
					                    <p class="weui_media_desc">快递单号：<font id="expcodeFont">${obj.expressNo }
					                    	<c:if test="${obj.expressNo != null }">
					                    		<a onclick="to('http://m.kuaidi100.com/index_all.html?type=${obj.expressCode }&postid=${obj.expressNo }');" style="color: red;"> &nbsp;配送查询</a>
					                    	</c:if>
					                    	</font>
					                    </p>
					                </div>
					                
												
							        <div align="right" style="width: 60px;">
						                <div style="display: block;padding-top: 6px;"></div>
						                <c:if test="${obj.state == '03' || obj.state == '04'}">
						                	<button type="button" id="btn${obj.type }${obj.sn }" onclick="dilivery('${obj.sn}','${obj.type }');"  class="weui_btn weui_btn_plain_primary weui_btn_mini">
								                    	签收
								            </button>
						                </c:if>
							         </div>
					            </div>
				        	</c:if>
				        	<c:if test="${obj.type == '2' }">
				        		<div class="weui_media_box weui_media_appmsg form-inline">
					                <div class="weui_media_bd">
					                    <h4 class="weui_media_title" style="width: 100%;">收件通知      
					                    	<div style="float: right;font-size: .8em;">
											     <i class="fa fa-calendar fa-fw"></i><fmt:formatDate value="${obj.createTm}" pattern="yyyy-MM-dd"/>
											</div>
					                    </h4>
					                    <p class="weui_media_desc">
					                    	签收状态：
					                    	<span style="width: 60%;" id="state${obj.type }${obj.sn}">
					                    		<c:choose>
									        		<c:when test="${obj.pickState == '01' }">已签收</c:when>
									        		<c:otherwise>未签收</c:otherwise>
									        	</c:choose>
					                    	</span>
					                    </p>
					                     <p class="weui_media_desc">
					                    	提取码：
					                    	<span style="width: 60%;color: red;">${obj.pickCode }</span>
					                    </p>
					                    <p class="weui_media_desc">
					                    	取件地址：
					                    	<span style="width: 60%">${obj.address }</span>
					                    </p>
					                </div>
					                
												
							        <div align="right" style="width: 60px;">
							        	<c:choose>
							        		<c:when test="${obj.pickState == '01' }"></c:when>
							        		<c:otherwise>
								                <div style="display: block;padding-top: 6px;"></div>
												<button type="button" id="btn${obj.type }${obj.sn }" onclick="dilivery('${obj.sn}','${obj.type }');"  class="weui_btn weui_btn_plain_primary weui_btn_mini">
									                    	签收
									            </button>							        		
							        		</c:otherwise>
							        	</c:choose>
						                	
							         </div>
					            </div>
				        	</c:if>
			        	</c:forEach>
			        	<c:if test="${fn:length(objs.data) == 0}">
					    	<div align="center" style="color: red;padding: 10px 0 20px 0px;">无数据</div>
					    </c:if>
				     </div>
			    </div>
				<%@ include file="/pages/wx/page.jsp"%>
				<div style="height: 40px;display: block;"></div>
	        </div>
	    </div>
	</div>
</form>
<div class="pop">
    <i class="fa fa-home fa-lg popi"></i>
</div>

<!-- 引入微信样式代码提示工具开始 -->
<%@ include file="/pages/wx/wxClass.jsp"%>
<!-- 引入微信样式代码提示工具结束 -->
<%@ include file="/pages/wx/baseBottom.jsp"%>
</body>
</html>

